/* RtspHls 组件样式 - 暗黑主题 */

/* 全局样式 - 暗黑主题 */
.rtsp-hls-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* 配置区域样式 */
.rtsp-hls-config-area {
  background-color: #2d2d2d;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  margin-bottom: 20px;
  border: 1px solid #404040;
}

.rtsp-hls-config-area h3 {
  color: #ffffff;
  margin-top: 0;
}

.rtsp-hls-config-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #404040;
}

.rtsp-hls-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.rtsp-hls-form-group label {
  font-size: 13px;
  color: #b0b0b0;
  font-weight: 500;
}

.rtsp-hls-input[type="text"],
.rtsp-hls-input[type="number"] {
  padding: 8px 12px;
  border: 1px solid #555;
  border-radius: 4px;
  font-size: 14px;
  background-color: #3a3a3a;
  color: #e0e0e0;
  transition: border-color 0.2s;
}

.rtsp-hls-input[type="text"]:focus,
.rtsp-hls-input[type="number"]:focus {
  outline: none;
  border-color: #4dabf7;
  box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.2);
}

.rtsp-hls-input[type="text"]::placeholder,
.rtsp-hls-input[type="number"]::placeholder {
  color: #888;
}

#streamName { width: 150px; }
#rtspUrl { width: 400px; }
#hlsPort { width: 100px; }

/* 按钮样式 */
.rtsp-hls-button {
  background-color: #4dabf7;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s;
}

.rtsp-hls-button:hover {
  background-color: #339af0;
}

.rtsp-hls-button.btn-sm {
  padding: 4px 8px;
  font-size: 12px;
}

.rtsp-hls-button.stop-btn {
  background-color: #ff6b6b;
}

.rtsp-hls-button.stop-btn:hover {
  background-color: #ff5252;
}

.rtsp-hls-button.delete-btn {
  background-color: transparent;
  color: #ff6b6b;
  padding: 4px 8px;
}

.rtsp-hls-button.delete-btn:hover {
  background-color: rgba(255, 107, 107, 0.1);
}

/* 表格样式 */
.rtsp-hls-table-container {
  overflow-x: auto;
}

.rtsp-hls-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 14px;
  background-color: #2d2d2d;
}

.rtsp-hls-table th, 
.rtsp-hls-table td {
  border: 1px solid #404040;
  padding: 10px 12px;
  text-align: left;
  color: #e0e0e0;
}

.rtsp-hls-table th {
  background-color: #363636;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
}

.rtsp-hls-table tr:nth-child(even) {
  background-color: #363636;
}

.rtsp-hls-table tr:hover {
  background-color: #404040;
}

.rtsp-hls-url {
  color: #4dabf7;
  word-break: break-all;
  font-size: 13px;
}

/* 日志区域样式 */
.rtsp-hls-log-area {
  background-color: #2d2d2d;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid #404040;
}

.rtsp-hls-log-area h3 {
  color: #ffffff;
  margin-top: 0;
}

.rtsp-hls-log {
  width: 100%;
  min-height: 300px;
  /* 重新添加最大高度限制，但使用更可靠的计算方式 */
  max-height: 400px;
  border: 1px solid #404040;
  border-radius: 4px;
  padding: 10px;
  overflow-y: auto;
  margin-top: 10px;
  font-family: Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.5;
  background-color: #1a1a1a;
  color: #e0e0e0;
  flex: 1;
}

/* 优化日志区域容器 */
.rtsp-hls-log-area {
  background-color: #2d2d2d;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid #404040;
  /* 确保日志区域不会超出父容器 */
  max-height: 500px;
}

/* 状态样式 */
.rtsp-hls-status-running { color: #51cf66; }
.rtsp-hls-status-stopped { color: #adb5bd; }
.rtsp-hls-status-retrying { color: #ffd43b; }
.rtsp-hls-status-error { color: #ff6b6b; }

/* 日志颜色样式 */
.rtsp-hls-error-log { color: #ff6b6b; }
.rtsp-hls-retry-log { color: #ffd43b; }
.rtsp-hls-info-log { color: #51cf66; }

/* 预览窗口样式 */
.rtsp-hls-preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
  box-sizing: border-box;
}

.rtsp-hls-preview-content {
  background-color: #2d2d2d;
  border-radius: 8px;
  padding: 20px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid #404040;
  color: #e0e0e0;
}

.rtsp-hls-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #404040;
}

.rtsp-hls-preview-header h3 {
  margin: 0;
  color: #ffffff;
}

.rtsp-hls-url-container {
  margin-bottom: 15px;
}

.rtsp-hls-url-label {
  font-weight: bold;
  margin-bottom: 5px;
  color: #b0b0b0;
}

.rtsp-hls-url-display {
  padding: 10px;
  background-color: #1a1a1a;
  border: 1px solid #404040;
  border-radius: 4px;
  font-family: Consolas, monospace;
  font-size: 13px;
  word-break: break-all;
  margin-bottom: 8px;
  color: #4dabf7;
}

.rtsp-hls-video-container {
  text-align: center;
  width: 100%;
  height: 100%;
}

.rtsp-hls-load-info {
  color: #adb5bd;
  margin-top: 10px;
  font-size: 14px;
}

.rtsp-hls-load-error {
  color: #ff6b6b;
  margin-top: 10px;
  font-size: 14px;
}

/* 页面标题样式 */
.rtsp-hls-header h1 {
  color: #ffffff;
  text-align: center;
  margin-bottom: 20px;
  font-size: 2rem;
  font-weight: 600;
}

/* 滚动条样式 */
.rtsp-hls-log::-webkit-scrollbar {
  width: 8px;
}

.rtsp-hls-log::-webkit-scrollbar-track {
  background: #2d2d2d;
}

.rtsp-hls-log::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}

.rtsp-hls-log::-webkit-scrollbar-thumb:hover {
  background: #666;
}